// let app = getApp();

Component({
  properties: {
    type: {
      type: String,
      value: '',
    },
    id: {
      type: String,
      value: '',
    },
    priceType: {
      type: String,
      value: '',
    },
    price: {
      type: String,
      value: '',
    },
    priceSymbol: {
      type: String,
      value: '',
    },
    discount: {
      type: String,
      value: '',
    },
    discountSymbol: {
      type: String,
      value: '',
    },
    full: {
      type: String,
      value: '',
    },
    time: {
      type: String,
      value: '',
    },
    detail: {
      type: String,
      value: '',
    },
    use_desc: {
      type: String,
      value: '',
    },
    title: {
      type: String,
      value: '',
    },
    totalNum: {
      type: String,
      value: '',
    },
    getNum: {
      type: String,
      value: '',
    },
    status: {
      type: String,
      value: '',
    },
    togetEvent: {
      type: String,
      value: '',
    },
    touseEvent: {
      type: String,
      value: '',
    },
    image: {
      type: String,
      value: '',
    },

    width: {
      type: String,
      value: '',
    },
    height: {
      type: String,
      value: '',
    },
    color: {
      type: String,
      value: '',
    },
    background: {
      type: String,
      value: '',
    },
    decimal: {
      type: String,
      value: '',
    },
    icon: {
      type: String,
      value: '',
    },
    symbolRight: {
      type: Boolean,
      value: false,
    },
    detailElip: {
      type: String,
      value: '',
    },
    detailColor: {
      type: String,
      value: '',
    },
    leftBgColor: {
      type: String,
      value: '',
    },
    rightBgColor: {
      type: String,
      value: '',
    },
    splitLineColor: {
      type: String,
      value: '',
    },
  },
  data: {
    detailClose: true,
  },
  methods: {
    _togetEvent(e) {
      console.log('coupon组件togetEvent1');
      let id = this.id;
      this.triggerEvent('togetEvent', { id });
    },

    _touseEvent(e) {
      console.log('coupon组件touseEvent1');
      let id = this.id;
      this.triggerEvent('touseEvent', { id });
    },

    _detailTap() {
      let that = this;
      that.setData({
        detailClose: !that.data.detailClose,
      });
    },

    _usedEvent() {
      wx.showToast({
        title: '已经使用过啦',
        icon: 'none',
      });
    },

    _overdueEvent() {
      wx.showToast({
        title: '已经过期啦',
        icon: 'none',
      });
    },

    _nomoreEvent() {
      wx.showToast({
        title: '已经抢光啦',
        icon: 'none',
      });
    },

  },
});
